pull: Ensure we begin a status line
authorColin Walters <walters@verbum.org>
Fri, 10 Jan 2014 13:15:54 +0000 (08:15 -0500)
committerColin Walters <walters@verbum.org>
Fri, 10 Jan 2014 13:15:54 +0000 (08:15 -0500)
Otherwise if the operation completes before anything happens, we hit
an assertion trying to end a status line when we didn't begin one.

src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-builtin-pull.c

index 124950183ec3042ef5e1f7a9b0edff52d0508639..299c6a815163a1e23ad8f2ec2702b4c90f9f9c5f 100644 (file)
@@ -110,7 +110,10 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel
 
       console = gs_console_get ();
       if (console)
-        progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
+        {
+          gs_console_begin_status_line (console, "", NULL, NULL);
+          progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
+        }
 
       g_print ("Fetching remote %s ref %s\n", origin_remote, origin_ref);
 
index 67305fdcfa7f10d5da21e0697185c14b7501f804..7aa028a7f5c985e0482a7bc2113eeeea5c75cbe5 100644 (file)
@@ -66,7 +66,10 @@ ostree_builtin_pull (int argc, char **argv, OstreeRepo *repo, GCancellable *canc
 
   console = gs_console_get ();
   if (console)
-    progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
+    {
+      gs_console_begin_status_line (console, "", NULL, NULL);
+      progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
+    }
 
   if (!ostree_repo_pull (repo, remote, refs_to_fetch ? (char**)refs_to_fetch->pdata : NULL,
                          pullflags, progress, cancellable, error))